<?php
/**
	管理员自身修改资料的模型
 */

/**
 * Form model for updating an authorization item.
 */
class EditDatumForm extends CFormModel {
	/**
	 *
	 * @var string item name.
	 */
	public $user_name;
	public $realname;
	public $user_id;
	
	/**
	 * Returns the attribute labels.
	 *
	 * @return array attribute labels (name=>label)
	 */
	public function attributeLabels() {
		return array (
				'user_name' => '用户名',
				'realname' => '真实姓名',
				'user_id' => '友声用户ID' 
		);
	}
	
	/**
	 * Returns the validation rules for attributes.
	 *
	 * @return array validation rules.
	 */
	public function rules() {
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array (
				array (
						'user_name',
						'required' 
				),
				array (
						'user_id',
						'numerical',
						'integerOnly' => true 
				),
				array (
						'user_name',
						'length',
						'max' => 45 
				),
				
				array (
						'realname',
						'length',
						'max' => 20 
				),
			
		);
	}
}
